<style>
<!--
	.nav-tabs {
		margin-bottom: 0px;
	}
    .modal-footer {
        margin-top: 33%;
    }
-->
</style>
<div ng-show="!selectAssignee">
    <tabset>
        <tab>
            <tab-heading>
                <i class="icon-doc"></i> {{task.name || "表单"}}
            </tab-heading>
            <form action="#" id="properties-form" class="form-horizontal  w5c-form" w5c-form-validate name="taskValidateForm" style="margin-top: 0px;">
                <!-- 外置表单-->
                <div class="form-body" ng-if="key" style="border-width: 1px; border: 1px solid lightgray;margin: 0px 0px 15px;padding: 10px;">
                    <div data-ng-include="key">
                    </div>
                </div>
                <!-- 任务办理表单-->
                <div class="form-body" ng-if="!key && properties" style="border-width: 1px; border: 1px solid lightgray;margin: 0px 0px 15px;padding: 10px;">
                    <div class="form-group" ng-repeat="property in properties">
                        <label class="col-md-2 control-label">{{property.name}}</label>
                        <div class="col-md-6">
                           <select class="form-control" name="{{property.id}}" ng-model="task.form[property.id]" ng-options="opt.value as opt.name for opt in property.type.values" ng-if="property.type.name == 'enum'"></select>
                            <textarea rows="3" class="form-control" name="{{property.id}}" ng-model="task.form[property.id]" ng-maxlength="200" ng-if="property.type.name == 'string'"></textarea>
                            <input ed-date-picker class="form-control date-picker" name="{{property.id}}" ng-model="task.form[property.id]" ng-if="property.type.name == 'date'" />
                            <div ed-user-select ed-repeat="false" ed-order="true" name="{{property.id}}" ng-model="task.form[property.id]" ed-multiple="true"  ng-if="property.type.name == 'userMultiSelect'" ></div>
                            <div ed-user-select ed-repeat="false" ed-order="true" name="{{property.id}}" ng-model="task.form[property.id]" ed-multiple="false"  ng-if="property.type.name == 'userSelect'" ></div>
                        </div>
                    </div>
                </div>
                <div class="form-actions">
                    <div class="row" style="text-align: center;">
                            <button type="button" class="btn green" w5c-form-submit="approval({{button}})" ng-repeat="button in buttons"><i class="fa fa-save"></i> {{button.name}}</button>
                            <button type="button" class="btn green" w5c-form-submit="toBack()"><i class="fa fa-save"></i> 退回</button>
                    </div>
                </div>
            </form>
        </tab>
        <tab>
            <tab-heading>
                <i class="icon-bar-chart"></i> 流程图
            </tab-heading>
            <iframe id="bpm-process" ng-src="{{processPath}}" frameborder="0" style="width: 100%;"></iframe>
        </tab>
        <tab ng-if="processInstanceId != ''">
            <tab-heading>
                <i class="icon-list"></i> 流程轨迹
            </tab-heading>
            	<div class="portlet" >
			        <div class="portlet-title">
			            <div class="caption">
			            		轨迹列表
			            </div>
			        </div>
			        <div class="portlet-body">
			            <table  ed-grid="processTrackGrid" class="table table-striped table-bordered table-advance table-hover"
			                   ed-url="bpm/process/{{processInstanceId}}/track.do" ed-model="actHis" width="100%">
			                <thead>
			                <tr>
			                    <th ed-data="_index"></th>
			                    <th ed-data="actName">流程环节</th>
			                    <th ed-data="startTime">开始时间</th>
			                    <th ed-data="assigneeName">办理人</th>
			                    <th ed-data="endTime">办理时间</th>
			                    <th ed-data="comment">办理意见</th>
			                </tr>
			                </thead>
            			</table>
			        </div>
			    </div>
        </tab>

        <div class="actions" style="padding-top: 3px;float: right;padding-right: 20px;">
            <a class="btn btn-circle btn-icon-only btn-default" href="javascript:;" ng-click="cancel();">
                <i class="icon-action-undo"></i>
            </a>
        </div>
    </tabset>
</div>

<div ng-show="selectAssignee">
    <h3 class="page-title">
        选择办理人
    </h3>
    <div class="portlet light bordered edit">
        <div class="portlet-body form">
        	<div class="actions" style="padding-left: 90%;padding-top: 3px;">
	            <a class="btn btn-circle btn-icon-only btn-default" href="javascript:;" ng-click="selectCancel();">
	                <i class="icon-action-undo"></i>
	            </a>
        	</div>
            <!-- BEGIN FORM-->
            <form action="#" class="form-horizontal w5c-form" w5c-form-validate name="taskAssignForm">
                <div class="form-body">
                    <div class="form-group" ng-repeat="assigneeEl in assigneeElements">
                        <label class="col-md-3 control-label">{{assigneeEl.name}}</label>
                        <div class="col-md-4">
                            <div ed-user-select ed-repeat="false" ed-order="true" ed-multiple="{{assigneeEl.type == 'userMultiSelect'}}" ng-model="assigneeEl.value"></div>
                        </div>
                    </div>
                    <div class="form-actions">
	                    <div class="row">
	                        <div class="col-md-offset-3 col-md-8">
	                			<button type="button" class="btn green" w5c-form-submit="approval(currentButton)" ><i class="fa fa-save"></i> 提交</button>            
	                        </div>
	                    </div>
                	</div>
                </div>
            </form>
            <!-- END FORM-->
            
        </div>
    </div>
</div>

<div ed-modal="toBackModal" style="height: 330px;min-width: 542px;" data-options="title: '退回',
                icon: 'fa-plus', onOkClick : toBackModalTrue, onHidden : toBackModalFalse">
        <div>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                <form action="#" class="form-horizontal" w5c-form-validate name="validateProfessorForm">
                    <div class="form-body" style="height: auto;" ng-if="details.purchase.projectFileType != '1'">
                        <div ng-repeat="backAct in actList">
                            <input type="radio" ng-click="clickBackAct(backAct.activityId)">
                            <span>{{backAct.actName}}</span>
                        </div>
                    </div>
                </form>
                <!-- END FORM-->
            </div>
        </div>
    </div>

<!-- BEGIN MAIN JS -->
<script>
    $('#bpm-process').height($('.page-content-wrapper').height() - 100);
	
	

</script>
<!-- END MAIN JS -->